package com.spark.lola.logistics.mapper;

import com.spark.lola.logistics.entity.OrderProduct;
import com.spark.lola.support.mybatis.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author: Zhi-peng wang
 * @date: 2020/04/26 16:09
 * 货运单商品信息mapper
 **/
@Mapper
public interface LogisticsOrderProductMapper extends BaseMapper<OrderProduct> {

    @Select("select * from logistics_order_product where order_id=#{orderInfoId}")
    List<OrderProduct> findByOrderId(long orderInfoId);

    @Select("select id from logistics_order_product where order_id=#{orderInfoId}")
    List<Long> findIdByOrderId(long orderInfoId);

    @Delete("delete from logistics_order_product where order_id=#{orderInfoId}")
    int deleteByOrderId(long orderInfoId);

}
